import request from '@/utils/request'

// 获取钉钉机器人配置
export function getDingTalkConfig() {
  return request({
    url: '/api/v1/home/dingtalk/robot/',
    method: 'get'
  })
}

// 更新钉钉机器人配置
export function setDingTalkConfig(data) {
  return request({
    url: '/api/v1/home/dingtalk/robot/',
    method: 'put',
    data
  })
}

// 删除钉钉机器人配置
export function deleteDingTalkConfig() {
  return request({
    url: '/api/v1/home/dingtalk/robot/',
    method: 'delete'
  })
}

// 发送钉钉消息
export function sendDingTalkMessage(data) {
  return request({
    url: '/api/v1/home/dingtalk/send/',
    method: 'post',
    data
  })
}

// 获取最新的实时检测数据
export function getRealtimeLastData() {
  return request({
    url: '/api/v1/detection/statistics/realtime/last/',
    method: 'get'
  })
}

// 获取最新的视频检测数据
export function getVideoLastData() {
  return request({
    url: '/api/v1/detection/statistics/video/last/',
    method: 'get'
  })
} 